﻿using JDKD.BMCS.Instruction;
using NutShell.DesignPattern;

namespace JDKD.BMCS.Business
{
        public class PushOperation : Operation
        {
                public PushOperation(int id, bool modify)
                        : base("Raise", id, modify)
                {
                }

                public override void Run()
                {
                        SerialPortCommunication.SendPushInstruction(Id, Modify);
                        
                        BusinessCache cache = Singleton<BusinessCache>.Instance;
                        cache.Groups[Id].IsPushing = Modify;
                }
        }
}